//
//  AULoginTextField.swift
//  AwesomeUBaseModule
//
//  Created by Miss_Special on 2018/5/9.
//

import UIKit

let kLoginTextFieldPlaceholderColorKeyPath = "_placeholderLabel.textColor"

class AULoginTextField: UITextField {

    override func awakeFromNib() {
        
        setValue(UIColor.gray, forKeyPath: kLoginTextFieldPlaceholderColorKeyPath)
        tintColor = textColor
    }
    
    override func becomeFirstResponder() -> Bool {
        setValue(textColor, forKeyPath: kLoginTextFieldPlaceholderColorKeyPath)
        
        return super.becomeFirstResponder()
    }
    
    override func resignFirstResponder() -> Bool {
        setValue(UIColor.gray, forKeyPath: kLoginTextFieldPlaceholderColorKeyPath)
        
        return  super.resignFirstResponder()
    }

}
